package com.yuyou.train.user.vo.req;

import org.apache.commons.lang3.StringUtils;

import com.yuyou.train.util.bean.ResBoolSimpleInfo;


public class ReqBehaviorEnd {

	private String content;
	
	private Integer star;
	
	

	public Integer getStar() {
		return star;
	}

	public void setStar(Integer star) {
		this.star = star;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	
	public static ResBoolSimpleInfo<String> validate(ReqBehaviorEnd req){
		ResBoolSimpleInfo<String> res=new ResBoolSimpleInfo<String>();
		if(req==null){
			res.setSuccess(false);
			res.setMessage("点评字数不能为空");
			return res;
		}else if(StringUtils.isEmpty(req.getContent())){
			res.setSuccess(false);
			res.setMessage("点评字数不能为空");
			return res;
		}
		else if(req.getStar()==null){
			res.setSuccess(false);
			res.setMessage("打星不能为空");
			return res;
		}else if(req.getContent().trim().length()<15){
			res.setSuccess(false);
			res.setMessage("点评字数长度最少是15个字");
			return res;
		}	
		return ResBoolSimpleInfo.getSuccessInfo();
	}
	

}
